{template Public:Page:header}
<div class="container">
  <div class="row"> 
  {template Member:Index:sidebar}
    <div class="col-lg-10 well-col-pl-30">
      <div class="row">
        <div class="well">
         <div class="row"><div class="col-lg-10"><h3><a class="btn btn-default black" href="{echo U('/member/dialog')}"><i class="fa fa-mail-reply"></i> 站内消息</a></h3></div><div class="col-lg-2 text-right">
         
         <a href="javascript:void(0);" class="btn btn-info" onclick="dialogmessage()"><i class="fa fa-comment-o"></i>写消息</a>
         </div></div>
           
                <form data-bv-feedbackicons-validating="glyphicon glyphicon-refresh" data-bv-feedbackicons-invalid="glyphicon glyphicon-remove" data-bv-feedbackicons-valid="glyphicon glyphicon-ok" class="form-horizontal bv-form well padding-bottom-10" method="post" id="Form" novalidate="novalidate">
                 
                        <textarea placeholder="内容" class="form-control" rows="2" name="content"></textarea>
                        <input name="touid" type="hidden" value="{echo $manage['touid']}" />
                        <input name="Submit" type="hidden" value="1" />
                        <input name="datatype" type="hidden" value="json" />

                    <div class="padding-top-10 text-align-right">
                        	<button class="btn btn-sm btn-primary" type="submit">发 送</button>
                    </div>
                </form>
                <div>
       			 {if $list}    
  				 {foreach $list $value}
                    <div class="comment">
                        {echo GetAvatarSimple($value['fromuid'],48,'comment-avatar')}
                        <div class="comment-body">
                            <div class="comment-text">
                                <div class="comment-header">
                                    <a title="" href="#">{echo $value['fromname']}</a><span>{echo FormatDate("Y/m/d H:i:s",$value['dateline'])}</span>
                                </div>
                                {echo $value['content']}
                            </div>
                            <div class="comment-footer">
                                <a href="javascript:void(0);" onclick=" Confirm({echo $value['id']},'消息ID{echo $value['id']}','{echo U('/post/dialogmessage/delete/id/'.$value['id'])}')   "><i class="fa fa-trash-o"></i></a>
                            </div>
                        </div>
                    </div>
                {/foreach}
                
                {/if} 
                </div>

          	<div class="row DTTTFooter">
            <div class="col-sm-12 text-right">
              <div class="dataTables_paginate paging_bootstrap" id="simpledatatable_paginate">
                <ul class="pagination">
                  {if $page}{echo $page}{/if}
                </ul>
              </div>
            </div>
          </div>

                    
          </div>
      </div>
      
  
    </div>
  </div>
</div>

<script src="{echo AURL}/js/validation/bootstrapValidator.js"></script>
<script>

        $(document).ready(function () {

 		  $('#Form').bootstrapValidator({
                excluded: [':disabled'],
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
				fields: {
					content: {
						/*
						validators: {
							notEmpty: {
								message: '内容不能为空！'
							},
							stringLength: {
								min: 2,
								max: 200,
								message: '内容最少2个字到200字内！'
							}
						}
						*/
					}
				},
                submitHandler: function (form) {
					
				  $.post('{echo U("/post/dialog/insert")}',$("#Form").serialize(), function(json) {
					
					  	$('.bootbox').PhpappProgress({json:json});

				 		return true;
					
				  }, 'json');
				  

				 bootbox.dialog({
					 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
					 title: '<i class="icon fa fa-retweet"></i> 提交中',
					 closeButton: false
				 }).PhpappProgress({time:2000});
			 
				  return false; 
				 
                } 
			
            }) 

        });
</script>
     
{template Public:Page:footer}